﻿using System.Drawing;

namespace 一
{
    internal class Program
    {
        class MyStack<T>
        {
            public T[] Items;
            private int top, capacity;
            public MyStack(int size)
            {
                capacity = size;
                Items = new T[size];
                top = -1;
            }
            public void InitStack()
            {
                Items = new T[capacity];
                top = -1;
            }
            public void ClearStack()
            {
                top = -1;
            }
            public bool Push(T item)
            {
                if(top>=capacity-1)
                {
                    return false;
                }
                Items[++top] = item;
                return true;
            }
            public T Pop()
            {
                if(top<0)
                {
                    throw new InvalidOperationException("栈为空，无法执行出栈操作");
                }
                T item = Items[top];
                top--;
                return item;
            }
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
        }
    }
}
